<!doctype html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Flash</title>
		<link href="../skins/default.css" rel="stylesheet" />
        <style type="text/css" rel="stylesheet">
            body {
                margin: 0;
                font:12px/1.5 "sans serif",tahoma,verdana,helvetica;
                background-color:#F0F0EE;
                color:#222222;
                overflow:hidden;
            }
            form {
                margin:0;
            }
            label {
                cursor:pointer;
            }
            .main {
                padding: 0 10px;
            }
            .clearfix:after {
                content: ".";
                display: block;
                height: 0;
                clear: both;
                visibility: hidden;
            }
            .tab-navi {
                width:98%;
                border-bottom:1px solid #A0A0A0;
                padding-left:5px;
                margin-bottom:10px;
                
            }
            .tab-navi ul  {
                list-style-image:none;
                list-style-position:outside;
                list-style-type:none;
                margin:0;
                padding:0;
            }
            .tab-navi li {
                position: relative;
                border: 1px solid #A0A0A0;
                background-color: #E0E0E0;
                margin: 0 2px -1px 0;
                padding: 0 20px;
                float: left;
                line-height: 25px;
                text-align: center;
                color: #555555;
                cursor: pointer;
            }
            .tab-navi li.selected {
                background-color: #F0F0EE;
                border-bottom: 1px solid #F0F0EE;
                color: #000000;
                cursor: default;
            }
            .tab-navi li.on {
                background-color: #F0F0EE;
                color: #000000;
            }
            .table  {
                list-style-image:none;
                list-style-position:outside;
                list-style-type:none;
                margin:0;
                padding:0;
                display:block;
            }
            .table li {
                padding:0;
                margin:0;
                margin-bottom:10px;
                display:list-item;
            }
            .table li label {
                font-weight:bold;
            }
            .upload {
                position: relative;
                overflow: hidden;
            }
            input.url {
                width: 200px;
            }
            #imgFile {
                position: absolute;
                top: 0;
                right: 0;
                width: 70px;
                height: 25px;
                z-index: 811212;
                border: 0 none;
                opacity:0;
                filter:alpha(opacity=0);
            }
        </style>
		<script type="text/javascript">
    	  var KE = parent.KindEditor;
    	  var id = KE.util.getParam(location.href, 'id');
    			
          var fileManager = null;
          var allowUpload = (typeof KE.g[id].allowUpload == 'undefined') ? true : KE.g[id].allowUpload;
          var allowFileManager = (typeof KE.g[id].allowFileManager == 'undefined') ? false : KE.g[id].allowFileManager;
          var referMethod = (typeof KE.g[id].referMethod == 'undefined') ? '' : KE.g[id].referMethod;
          var flashUploadJson = (typeof KE.g[id].flashUploadJson == 'undefined') ? '../../../support/frontad/editorUpload.htm?fileType=1' : KE.g[id].flashUploadJson;
          var imageTabDefault = 0;
          var lang = KE.lang.plugins.image;
          KE.event.ready(function() {
              var typeBox = KE.$('type', document);
              var urlBox = KE.$('url', document);
              var localUrlBox = KE.$('localUrl', document);
              var viewServerBox = KE.$('viewServer', document);
              var viewLocalBox = KE.$('viewLocal', document);
              var fileBox = KE.$('imgFile', document);
              var widthBox = KE.$('width', document);
              var heightBox = KE.$('height', document);
              var tabNavi = KE.$('tabNavi', document);
              var liList = tabNavi.getElementsByTagName('li');
              var selectTab = function(num) {
                  for (var i = 0, len = liList.length; i < len; i++) {
                      var li = liList[i];
                      if (i === num) {
                          li.className = 'selected';
                          li.onclick = null;
                          if (KE.browser.IE) {
                              KE.util.focus(id);
                              KE.util.select(id);
                          }
                      } else {
                          if (allowUpload) {
                              li.className = '';
                              li.onmouseover = function() { KE.addClass(this, 'on'); };
                              li.onmouseout = function() { KE.removeClass(this, 'on'); };
                              li.onclick = (function (i) {
                                  return function() {
                                      if (!fileManager) selectTab(i);
                                  };
                              })(i);
                          } else {
                              li.parentNode.removeChild(li);
                          }
                      }
                      KE.$('tab' + (i + 1), document).style.display = 'none';
                  }
                  typeBox.value = num + 1;
                  KE.$('tab' + (num + 1), document).style.display = '';
              }
              selectTab(imageTabDefault);
              if (allowFileManager) {
                  KE.event.add(viewServerBox, 'click', function () {
                      if (fileManager) return false;
                      fileManager = new KE.dialog({
                          id : id,
                          cmd : 'file_manager',
                          file : 'file_manager/file_manager.html',
                          width : 500,
                          height : 400,
                          loadingMode : true,
                          title : KE.lang.fileManager,
                          noButton : KE.lang.no,
                          afterHide : function() {
                              fileManager = null;
                          }
                      });
                      fileManager.show();
                  });
              } else {
                  viewServerBox.style.display = 'none';
                  urlBox.style.width = '300px';
              }
              KE.event.add(fileBox, 'change', function() {
                  localUrlBox.value = fileBox.value;
              });
              KE.$('uploadForm', document).action = flashUploadJson;
              KE.$('referMethod', document).value = referMethod;
              KE.util.pluginLang('flash', document);
              viewServerBox.value = lang.viewServer;
              viewLocalBox.value = lang.viewServer;
              KE.util.hideLoadingPage(id);
              if (imageTabDefault == 0) {
                  urlBox.focus();
                  urlBox.select();
              }
          }, window, document);
		</script>
	</head>
	<body>
        <div class="main">
            <div id="tabNavi" class="tab-navi">
                <ul class="clearfix">
                    <li><span id="lang.remoteFlash"></span></li>
                    <li><span id="lang.localFlash"></span></li>
                </ul>
            </div>
            <iframe name="uploadIframe" id="uploadIframe" style="display:none;"></iframe>
            <input type="hidden" id="type" name="type" value="" />
            <form id="uploadForm" name="uploadForm" method="post" enctype="multipart/form-data" target="uploadIframe">
                <input type="hidden" id="editorId" name="id" value="" />
                <input type="hidden" id="referMethod" name="referMethod" value="" />
                <input type="hidden" name="imgBorder" value="0" />
                <ul class="table">
                    <li style="height:30px;">
                        <div id="tab1" style="display:none;">
                            <label for="url" class="ke-inline-block"><span id="lang.remoteUrl"></span></label>&nbsp;
                            <input type="text" id="url" name="url" value="http://" maxlength="255" class="ke-inline-block ke-text-input url" />
                            <span class="ke-button-common ke-button-outer btn">
                                <input type="button" class="ke-button-common ke-button" id="viewServer" value="" />
                            </span>
                        </div>
                        <div id="tab2" style="display:none;">
                            <label for="imgFile" class="ke-inline-block"><span id="lang.localUrl"></span></label>&nbsp;
                            <span class="ke-inline-block upload">
                                <input type="text" id="localUrl" length="255" class="ke-inline-block ke-text-input url" tabindex="-1" readonly="true" />
                                <span class="ke-button-common ke-button-outer btn">
                                    <input type="button" class="ke-button-common ke-button" id="viewLocal" value="" tabindex="-1" />
                                </span>
                                <input type="file" id="imgFile" name="imgFile" />
                            </span>
                        </div>
                    </li>
                    <li>
                        <label for="width" class="ke-inline-block"><span id="lang.width"></span></label>&nbsp;
                        <input type="text" id="width" name="width" value="550" maxlength="4" class="ke-inline-block ke-text-input" style="width:50px;text-align:right;" /> px
                    </li>
                    <li>
                        <label for="height" class="ke-inline-block"><span id="lang.height"></span></label>&nbsp;
                        <input type="text" id="height" name="height" value="400" maxlength="4" class="ke-inline-block ke-text-input" style="width:50px;text-align:right;" /> px
                    </li>
                </ul>
            </form>
        </div>
	</body>
</html>
